import time

import allure
from selenium.webdriver.common.by import By

from bazhuayun.page.base_octopus_cloud import BaseOctopusCloud
from bazhuayun.utils.log_utils import logger


class LogonHomePage(BaseOctopusCloud):

    @allure.step("登录")
    def logon_home_page(self):
        self.open_url("http://wxorder.taover.com/login?redirect=%2Fdashboard")
        self.login_by_cookie()
        time.sleep(2)
        logger.info("登录到首页")

        from bazhuayun.page.homepage import HomePage
        return HomePage(self.driver)
